package homework;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class Inputstream {

	public static void main(String[] args) throws IOException{
		InputStream f = new FileInputStream("d:text.jpg");
		
		OutputStream out = new FileOutputStream("d:text_copy.jpg");
		byte[] buffer = new byte[1024];
		while(true) {
			int length = f.read(buffer);
			if(length == -1) {
				break;
			}
			out.write(buffer);
		}
		f.close();
		out.close();
		
			}

}
